<template>
    <div class="home-div">
        <Search></Search>
        <Swipe></Swipe>
        <Service :serviceList="serviceList"></Service>
    </div>
</template>

<script>
import Search from "./Search"
import Swipe from './Swipe'
import Service from './Service'
export default {
    name: "Home",
    components:{
        Search,
        Swipe,
        Service
    },
    data() {
        return {
            // 服务列表
            serviceList: [],
            // 当前页数
            currentPag: 1,
            // 每页大小
            pageSize: 10,
            // 总页数
            pageTotal: null,
            // 搜索内容
            content: ""
        }
    },
    mounted() {
        this.init()
    },
    methods: {
        async init(){
            let res = await this.$store.dispatch('getServicePag', {
                currentPag: this.currentPag,
                pageSize: this.pageSize,
                content: null
            })
            if(res.success) this.serviceList = res.data.serviceDtoList
            else this.$myFun.resError(res.message)
        }
    },
}
</script>

<style scoped>
.home-div{
    width: 95%;
    margin: 0 auto;
}

</style>